<template>
  <div>
    <el-select v-model="formInline.tags" :size="size" filterable clearable @change="onChange">
      <el-option label="未打标签" value="未打标签" v-if="filter" />
      <el-option label="选择客户标签" value="" v-else />
      <el-option label="A:意向高" value="A:意向高" />
      <el-option label="B:意向中" value="B:意向中" />
      <el-option label="C:意向低" value="C:意向低" />
      <el-option label="D:未接通/客户忙" value="D:未接通/客户忙" />
      <el-option label="Y:暂时做不了" value="Y:暂时做不了" />
    </el-select>
  </div>
</template>
  <script>
export default {
  name: "TagSelect",
  props: {
    value: {
      type: [String, Number],
      default: "",
    },
    multiple: {
      type: Boolean,
      default: true,
    },
    size: {
      type: String,
      default: "small",
    },
    filter: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      formInline: {},
    };
  },
  watch: {
    value: {
      handler: function (n, o) {
        this.$set(this.formInline, "tags", n);
      },
      immediate: true,
    },
  },
  created() {},
  methods: {
    // 监听组件变化
    onChange(e) {
      console.log(e);
      this.$emit("input", e.toString());
      this.$emit("change", e);
    },
  },
};
</script>
  <style lang="scss" scoped>
</style>